package com.one.square.file.interfaces.service.service;

import com.one.square.core.domain.Result;
import com.one.square.core.entity.FileInfo;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author cwm
 * @Description 文件接口
 * @date 2021/10/27 下午3:06
 * @Version 1.0
 */
@RequestMapping("/file")
public interface FileInterFace {
    /**
     * 文件上传
     * 根据fileType选择上传方式
     *
     * @param file
     * @return
     * @throws Exception
     */
    @PostMapping("/files-anon")
    Result<FileInfo> upload(@RequestParam("file") MultipartFile file) throws Exception;

    /**
     * 文件删除
     *
     * @param id
     */
    @DeleteMapping("/files/{id}")
    Result delete(@PathVariable String id);
}
